﻿using Abp.Authorization;
using Abp.Localization;
using Abp.MultiTenancy;

namespace ALEXFW.Authorization
{
    public class ALEXFWAuthorizationProvider : AuthorizationProvider
    {
        public override void SetPermissions(IPermissionDefinitionContext context)
        {
            context.CreatePermission(PermissionNames.Pages_Admin, L("Admin"));
            context.CreatePermission(PermissionNames.Pages_Manager, L("Manager"));
            context.CreatePermission(PermissionNames.Pager_User, L("User"));
            context.CreatePermission(PermissionNames.Pages_Tenants, L("Tenants"), multiTenancySides: MultiTenancySides.Host);
        }

        private static ILocalizableString L(string name)
        {
            return new LocalizableString(name, ALEXFWConsts.LocalizationSourceName);
        }
    }
}
